package com.stockz.equity.indicator.vsa.pattern;

import java.util.List;

import org.springframework.stereotype.Component;

import com.stockz.equity.indicator.vsa.VsaBar;
import com.stockz.equity.indicator.vsa.property.Close;
import com.stockz.equity.indicator.vsa.property.Region;
import com.stockz.equity.indicator.vsa.property.Type;
import com.stockz.equity.indicator.vsa.property.Volume;
import com.stockz.equity.model.Bar;

@Component
public class BuyingClimax extends VsaPattern {

	public BuyingClimax() {
		super("BC", "Buying Climax", VsaPatternType.Bearish);
	}

	@Override
	public void analyze(List<Bar> barList,List<VsaBar> vsaBarList, int index) {
		VsaBar vsaBar = vsaBarList.get(index);
		if(Region.OverBaught.equals(vsaBar.getRegion())
				&& Type.Up.equals(vsaBar.getType())
				&& !Close.High.equals(vsaBar.getClose())
				&&(Volume.Climatic.equals(vsaBar.getVolume())
						|| Volume.UltraHigh.equals(vsaBar.getVolume()))
				/*&& (AverageTradeSize.UltraHigh.equals(vsaBar.getAverageTradeSize())
						|| AverageTradeSize.High.equals(vsaBar.getAverageTradeSize()))*/){
			vsaBar.getVsaPatternList().add(this);
		}
	}
}
